package fun.sanguo.service.sys;

import fun.sanguo.model.dto.DataInfo;
import fun.sanguo.model.dto.DataQuery;
import fun.sanguo.model.dto.PageInfo;
import fun.sanguo.model.dto.PageQuery;
import fun.sanguo.model.dto.sys.*;
import fun.sanguo.model.entity.sys.SysUserEntity;
import fun.sanguo.utils.exception.ArtificialException;

/**
 * 系统-用户信息 Service接口
 *
 * @author ZYP
 * @date 2023-06-09
 */
public interface SysUserService {

    /**
     * 验证用户注册操作
     *
     * @param dataQuery
     * @return
     * @throws ArtificialException
     */
    DataInfo<SysUserLogonResult> logon(DataQuery<SysUserLogonParam> dataQuery) throws ArtificialException;

    /**
     * 验证用户登陆操作
     *
     * @param dataQuery
     * @return
     * @throws ArtificialException
     */
    DataInfo<SysUserLoginResult> login(DataQuery<SysUserLoginParam> dataQuery) throws ArtificialException;

    /**
     * 获取当前登陆用户信息
     *
     * @return
     * @throws ArtificialException
     */
    DataInfo<SysUserEntity> getCurrentUser() throws ArtificialException;

    /**
     * 获取当前登陆用户ID
     *
     * @return
     * @throws ArtificialException
     */
    String getCurrentUserId() throws ArtificialException;

    /**
     * 获取当前登陆用户ID或默认空
     *
     * @return
     * @throws ArtificialException
     */
    String getCurrentUserIdOrEmpty();

    /**
     * 查询页面table列表
     *
     * @param pageQuery
     * @return
     * @throws ArtificialException
     */
    PageInfo<SysUserEntity> getPage(PageQuery<SysUserParam> pageQuery) throws ArtificialException;
}
